<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var freqAlphabets = function (s) {
      let array = []
      for (i = s.length - 1; i >= 0; i--) {
        if (s[i] !== '#') {
          //将 Unicode 编码转为一个字符
          array.push(String.fromCharCode(Number(s[i]) + 96))
        } else {
          array.push(String.fromCharCode(Number(s.slice(i - 2, i)) + 96))
          i = i - 2
        }
      }
      return array.reverse().join("")
    };
    console.log(freqAlphabets(s = "1326#"))
  </script>
</body>

</html>